/**
 * 处理文件上传
 *
 * User: ZhangXiao
 * Date: 14-4-28
 * Time: 下午8:49
 * File: usr/upload_handler.js.
 */


exports.handlers = {
    "/upload": upload_handler
}


var util = require("util");
var url = require("url");
var http = require("http");
var path = require("path");

function upload_handler(request, reponse, options) {

    var postData = "";

    request.setEncoding("utf-8");
    /**
     * 上传文件POST数据解析，可以使用已有的第三方组件，也可以自己实现（比较困难）
     */
//    request.addListener("data", function (postDataChunk) {
//        postData += postDataChunk;
//    });

//    request.addListener("end", function () {
//        console.info(postData);
//    });
}